package com.whitedust.ltzf.payments.nativepay.model;

import com.whitedust.ltzf.utils.SignUtils;
import lombok.Getter;
import lombok.Setter;

import java.util.HashMap;
import java.util.Map;

/**
 * @author A
 * @since 2025/7/25 15:02
 */
@Getter
public class QueryOrderByOutTradeNoRequest {
    @Setter
    private String mchId;
    @Setter
    private String outTradeNo;
    private final String timestamp = String.valueOf(System.currentTimeMillis()/1000);

    public String creatSign(String partnerKey){
        Map<String,String> dataMap = new HashMap<>();
        dataMap.put("mch_id",getMchId());
        dataMap.put("out_trade_no",getOutTradeNo());
        dataMap.put("timestamp",timestamp);
        return SignUtils.createSign(dataMap,partnerKey);
    }
}
